<template>
    <div class="goodsdesc-container">
        <h3>{{goodsdesc.title}}</h3>
        <hr>
        <div class="content" v-html="goodsdesc.content"></div>
    </div>
</template>

<script>

    import { Toast } from 'mint-ui'
    export default {
      data() {
            return {
                id:this.$route.params.id,//将url地址中传递的id值挂载到data上,方便调用
                goodsdesc : {
                    id:1,
                    title:"商品详情",
                    content:"SD2000909809"
                }//图文介绍
            }
        },
        created() {
    //         this.getGoodsDesc();
        },
        methods: {
            getGoodsDesc(){
                this.$http.get('api/goods/getdesc'+this.id).then(result=>{
                    if(result.body.status == 0){
                        this.goodsdesc = result.body.message[0];
                    }else{
                        Toast('获取图文介绍数据失败')
                    }
                })
            }
        }  
    }
</script>

<style lang="scss" scoped>
    .goodsdesc-container{
        padding: 4px;
        h3{
            font-size: 16px;
            color: #226aff;
            text-align: center;
            margin: 15px 0;
        }
        .content{
            img{
                width: 100%;
            }
        }
    }
</style>
